<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var new2 = prompt('请问现在几点了')
        if (new2 >= 6 && new2 <= 12) {
            alert('上午好')
        } else if (new2 >= 13 && new2 <= 18) {
            alert('下午好')
        } else if (new2 >= 19 && new2 <= 23) {
            alert('晚上好')
        } else if (new2 >= 0 && new2 <= 5) {
            alert('滚蛋')
        }
    </script>
</body>

</html>